#pragma once
#include"cocos2d.h"
#include"Box2D\Box2D.h"
#include<vector>

class BackGroundLayer2:public cocos2d::Layer
{
public:
	BackGroundLayer2() {}
	~BackGroundLayer2() {}

	CREATE_FUNC(BackGroundLayer2);

	bool init();

	void initBox2dWorld();

	void addNewSpriteWithCoords(cocos2d::CCPoint location, cocos2d::CCSprite* pSprite);
protected:
	void CallCloseBack(cocos2d::CCObject *sender); 

	virtual void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *unused_event) override;

	void update(float dt);
private:
	b2World* m_world;
};

